<?php
class MovieHandler implements ExtensionInterface{
	public function handleExtension($file) {
		$extension = substr($file,strrpos($file,".")+1,strlen($file));
		$height = 320;
		if($extension == "mp3") {
			$height = 20;
		}
		
		$returnVal = "<script type='text/javascript' src='".Settings::getInstance()->getSetting("General.urlToCMS")."/kernel/contentExtensionHandler/mediaPlayer/swfobject.js'></script>

		  <div id='".$file."'></div>

		  <script type='text/javascript'>
		  var s1 = new SWFObject('".Settings::getInstance()->getSetting("General.urlToCMS")."/kernel/contentExtensionHandler/mediaPlayer/player.swf','ply','470','".$height."','9','#ffffff');
		  s1.addParam('allowfullscreen','true');
		  s1.addParam('allowscriptaccess','always');
		  s1.addParam('wmode','opaque');
		  s1.addParam('flashvars','file=".Settings::getInstance()->getSetting("General.urlToCMS")."content/".$file."');
		  s1.write('".$file."');
		</script>";
		return $returnVal;
	}
	
	public function getHandledExtensions() {
		return array("flv","mp4","mp3");
	}
}
?>